﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// DevHisRelation数据模型对象
    /// </summary>
    [Serializable]
    public partial class DevHisRelationMod
    {
        /// <summary>
        /// 初始化DevHisRelation数据模型对象
        /// </summary>
        public DevHisRelationMod()
        {
            
        }
        /// <summary>
        /// 初始化DevHisRelation数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="iMEI">IMEI</param>
        /// <param name="deviceNO">DeviceNO</param>
        /// <param name="cTime">CTime</param>
        public DevHisRelationMod(long iD,string iMEI,string deviceNO,DateTime cTime)
        {
            //给ID字段赋值
            this.ID = iD;
            //给IMEI字段赋值
            this.IMEI = iMEI;
            //给DeviceNO字段赋值
            this.DeviceNO = deviceNO;
            //给CTime字段赋值
            this.CTime = cTime;
        }
        
		//属性存储数据的变量
        private long _iD;
        private string _iMEI;
        private string _deviceNO;
        private DateTime _cTime;
        
        /// <summary>
        /// ID
        /// </summary>
        public long ID
        {
            get { return this._iD; }
            set { this._iD = value; }
        }
        /// <summary>
        /// IMEI
        /// </summary>
        public string IMEI
        {
            get { return this._iMEI; }
            set { this._iMEI = value; }
        }
        /// <summary>
        /// DeviceNO
        /// </summary>
        public string DeviceNO
        {
            get { return this._deviceNO; }
            set { this._deviceNO = value; }
        }
        /// <summary>
        /// CTime
        /// </summary>
        public DateTime CTime
        {
            get { return this._cTime; }
            set { this._cTime = value; }
        }
        
        /// <summary>
        /// 对比两个DevHisRelation数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的DevHisRelation数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成DevHisRelation数据模型对象
            DevHisRelationMod devHisRelationMod = obj as DevHisRelationMod;
            //判断是否转换成功
            if (devHisRelationMod == null) return false;
            //进行匹配属性的值
            return
                //判断ID是否一致
                this.ID == devHisRelationMod.ID &&
                //判断IMEI是否一致
                this.IMEI == devHisRelationMod.IMEI &&
                //判断DeviceNO是否一致
                this.DeviceNO == devHisRelationMod.DeviceNO &&
                //判断CTime是否一致
                this.CTime == devHisRelationMod.CTime;
        }
        /// <summary>
        /// 将当前DevHisRelation数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将DevHisRelation数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将ID进行按位异或运算处理
                this.ID.GetHashCode() ^
                //将IMEI进行按位异或运算处理
                (this.IMEI == null ? 2147483647 : this.IMEI.GetHashCode()) ^
                //将DeviceNO进行按位异或运算处理
                (this.DeviceNO == null ? 2147483647 : this.DeviceNO.GetHashCode()) ^
                //将CTime进行按位异或运算处理
                this.CTime.GetHashCode();
        }
        /// <summary>
        /// 将当前DevHisRelation数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前DevHisRelation数据模型对象转换成字符串副本
            return
                "[" +
                //将ID转换成字符串
                this.ID + "," +
                //将IMEI转换成字符串
                this.IMEI + "," +
                //将DeviceNO转换成字符串
                this.DeviceNO + "," +
                //将CTime转换成字符串
                this.CTime +
                "]";
        }
    }
}
